home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / CMPLTPAS / FONTSIZE.PAS < prev    next >
Pascal/Delphi Source File  |  1988-07-14  |  2KB  |  40 lines

  1. {->>>>DeterminePoints<<<<--------------------------------------}
  2. {                                                              }
  3. { Filename : FONTSIZE.SRC -- Last Modified 7/11/88             }
  4. {                                                              }
  5. { This routine determines the character cell height for the    }
  6. { font currently in use.  For the MDA and EGA this is hard-    }
  7. { wired; for the EGA, VGA, and MCGA the value must be obtained }
  8. { by querying the ROM BIOS.                                    }
  9. {                                                              }
  10. {     From: COMPLETE TURBO PASCAL 5.0  by Jeff Duntemann       }
  11. {    Scott, Foresman & Co., Inc. 1988   ISBN 0-673-38355-5     }
  12. {--------------------------------------------------------------}
  13.  
  14. FUNCTION DeterminePoints : Integer;
  15.  
  16. VAR
  17.   Regs : Registers;
  18.  
  19. BEGIN
  20.   CASE QueryAdapterType OF
  21.     CGA       : DeterminePoints := 8;
  22.     MDA       : DeterminePoints := 14;
  23.     EGAMono,        { These adapters may be using any of   }
  24.     EGAColor,       { several different font cell heights, }
  25.     VGAMono,        { so we need to query the BIOS to find }
  26.     VGAColor,       { out which is currently in use. }
  27.     MCGAMono,
  28.     MCGAColor : BEGIN
  29.                   WITH Regs DO
  30.                     BEGIN
  31.                       AH := $11;  { EGA/VGA Information Call }
  32.                       AL := $30;
  33.                       BL := 0;
  34.                     END;
  35.                   Intr($10,Regs);
  36.                   DeterminePoints := Regs.CX
  37.                 END
  38.   END  { CASE }
  39. END;
  40.